//package com.auerdi.ui.detail;
//
//import android.content.Context;
//import android.os.Bundle;
//import android.support.annotation.Nullable;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.ImageView;
//
//import com.auerdi.GlideApp;
//import com.auerdi.R;
//import com.example.egghttp.EggLog.L;
//import com.example.egghttp.RetrofitClient;
//import com.example.egghttp.retrofit.AdService;
//import com.example.egghttp.retrofit.beans.BOb;
//import com.example.egghttp.retrofit.beans.banner.BargainDatailResp;
//import com.example.egghttp.retrofit.beans.banner.Img;
//import com.example.egghttp.retrofit.beans.banner.ProdictCutDetailContainer;
//import com.example.egghttp.retrofit.beans.banner.SpecGoodsList;
//import com.example.egghttp.retrofit.beans.banner.SpecItemList;
//import com.example.egghttp.retrofit.beans.goods.CutProduct;
//import com.example.egghttp.retrofit.params.BargainDatailRequest;
//import com.youth.banner.Banner;
//import com.youth.banner.loader.ImageLoader;
//
//import java.util.List;
//
//import butterknife.BindView;
//import butterknife.ButterKnife;
//import butterknife.Unbinder;
//import me.yokeyword.fragmentation_swipeback.SwipeBackFragment;
//import rx.Subscriber;
//import rx.android.schedulers.AndroidSchedulers;
//import rx.schedulers.Schedulers;
//
///**
// * Created by YoKeyword on 16/2/14.
// */
//public class ADCutProductDetailFragment extends SwipeBackFragment {
//
//
//    private static CutProduct mProduct;
//    @BindView(R.id.title_left)
//    View titleLeft;
//    Unbinder unbinder;
//
//    @BindView(R.id.banner)
//    Banner banner;
//
//    public static ADCutProductDetailFragment newInstance(CutProduct product) {
//
//        Bundle args = new Bundle();
//
//        mProduct = product;
//
//        ADCutProductDetailFragment fragment = new ADCutProductDetailFragment();
//        fragment.setArguments(args);
//        return fragment;
//    }
//
//    @Override
//    public void onAttach(Context context) {
//        super.onAttach(context);
//    }
//
//    @Nullable
//    @Override
//    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//
//
//        L.d("hcia", "onCreateView:");
//        View view = inflater.inflate(R.layout.ad_fragment_product_detail_cut, container, false);
//
//
//        View tpview = attachToSwipeBack(view);
//        unbinder = ButterKnife.bind(this, tpview);
////        marketPrice.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG); // 设置中划线并加清晰
//
//
////        backhome.setOnClickListener(v -> EventBusActivityScope.getDefault(getActivity()).post(new GoHomeEvent()));
////        groupbuy.setOnClickListener(new View.OnClickListener() {
////            @Override
////            public void onClick(View v) {
////
////
////                CateGoryDialog.newInstance(mProduct, "1").show(getFragmentManager(), "");
////
////
////            }
////        });
////        buynow.setOnClickListener(new View.OnClickListener() {
////            @Override
////            public void onClick(View v) {
////
////
////                CateGoryDialog.newInstance(mProduct, "0").show(getFragmentManager(), "");
////
////
////            }
////        });
//
////        cusser.setOnClickListener(new View.OnClickListener() {
////            @Override
////            public void onClick(View v) {
////                startActivity(new Intent(getActivity(), WXEntryActivity.class));
////
////            }
////        });
//
//        titleLeft.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                pop();
//            }
//        });
//
//
//        RetrofitClient.getPDAClient().create(AdService.class).bargainDetails(new BargainDatailRequest(mProduct.getBargain_id(), mProduct.getGoods_id(), "", "", ""))
//                .subscribeOn(Schedulers.newThread())
//                .observeOn(Schedulers.io())
//                .observeOn(AndroidSchedulers.mainThread())
//                .subscribe(new Subscriber<BOb<BargainDatailResp>>() {
//                    @Override
//                    public void onCompleted() {
//
//                    }
//
//                    @Override
//                    public void onError(Throwable e) {
//
//                    }
//
//                    @Override
//                    public void onNext(BOb<BargainDatailResp> bargainDatailRespBOb) {
//                        L.d("hcia", "bargainDatailRespBOb.getBody().getGoods_name():" + bargainDatailRespBOb.getBody().getGoods_name());
//
//                        List<Img> coverList = bargainDatailRespBOb.getBody().getCover_images_list();
//                        banner.setImageLoader(new ImageLoader() {
//                            @Override
//                            public void displayImage(Context context, Object path, ImageView imageView) {
//                                Img banner = (Img) path;
//
//
//                                GlideApp.with(getActivity())
//                                        .load(banner.getImg_url())
//                                        .placeholder(R.mipmap.eptb)
//                                        .error(R.mipmap.eptb)
//                                        .centerInside()
//                                        .into(imageView);
//
//
//                            }
//                        });
//                        banner.setImages(coverList);
//                        banner.start();
//
//
//                    }
//                });
//
//
//        RetrofitClient.getPDAClient().create(AdService.class).bargainGoodsSpec(mProduct.getBargain_id(), mProduct.getGoods_id())
//                .subscribeOn(Schedulers.newThread())
//                .observeOn(Schedulers.io())
//                .observeOn(AndroidSchedulers.mainThread())
//                .subscribe(new Subscriber<BOb<ProdictCutDetailContainer>>() {
//                    @Override
//                    public void onCompleted() {
//
//                    }
//
//                    @Override
//                    public void onError(Throwable e) {
//
//                        L.d("hcia", "e:" + e);
//
//                    }
//
//                    @Override
//                    public void onNext(BOb<ProdictCutDetailContainer> prodictCutDetailContainerBOb) {
//                        List<SpecGoodsList> specGoods = prodictCutDetailContainerBOb.getBody().getSpecGoodsList();
//                        List<SpecItemList> SpecItems = prodictCutDetailContainerBOb.getBody().getSpecItemList();
//
////                        L.d("hcia", "specGoods.get(0).getKeyName():" + specGoods.get(0).getKeyName());
////                        L.d("hcia", "SpecItems.get(0).getSpecName():" + SpecItems.get(0).getSpecName());
//
//                    }
//                });
//
//
//        return tpview;
//    }
//
//
//    @Override
//    public void onDestroyView() {
//        super.onDestroyView();
//        unbinder.unbind();
//    }
//
//
//    @Override
//    public void onSupportInvisible() {
//        super.onSupportInvisible();
//        hideSoftInput();
//    }
//}
